package com.datawarehouse;

import java.util.ArrayList;
import java.util.List;

public class ScriptTableDeux {
	
	public static String CLIENT = "CREATE TABLE IF NOT EXISTS `client` ("+
  "`id_client` int(10) unsigned NOT NULL auto_increment,`nom` varchar(20) NOT NULL,"+
  "`prenom` varchar(20) NOT NULL,`date_naissance` datetime NOT NULL,`sexe` enum('m','f') NOT NULL,"+
  "`adresse` varchar(100) NOT NULL,`ville` varchar(40) NOT NULL,`pays` varchar(40) NOT NULL,"+
  "`code_postal` varchar(5) NOT NULL,`tel` varchar(15) NOT NULL,PRIMARY KEY  (`id_client`))";
	
	public static String GITE = "CREATE TABLE IF NOT EXISTS `gite` ("+
  "`id_gite` int(11) NOT NULL auto_increment,`type_gite` enum('Studio','Appartement','Villa','Chateau') NOT NULL,"+
  "`description` varchar(200) NOT NULL,`capacite` int(10) unsigned NOT NULL,"+
  "`surface` int(11) NOT NULL,`adresse` varchar(120) NOT NULL,"+
  "`ville` varchar(40) NOT NULL,`pays` varchar(40) NOT NULL,"+
  "`code_postal` varchar(5) NOT NULL,`proprietaire` varchar(40) NOT NULL,"+
  "`moyen_transportation` varchar(200) NOT NULL, PRIMARY KEY  (`id_gite`))";
	
	public static String RESERVATION = "CREATE TABLE IF NOT EXISTS `reservation` ("+
  "`id_reservation` int(11) NOT NULL auto_increment,`id_client` int(11) NOT NULL,"+
  "`id_gite` int(11) NOT NULL,`id_mode_paiement` int(11) NOT NULL,"+
  "`date_debut` datetime NOT NULL,`date_fin` datetime NOT NULL,"+
  "`prix` int(11) unsigned NOT NULL,`monnaie` varchar(20) NOT NULL,`nb_personnes` int(11) unsigned NOT NULL,"+
  "PRIMARY KEY  (`id_reservation`),KEY `id_client` (`id_client`,`id_gite`),KEY `id_gite` (`id_gite`))";
	
	public static String CALENDRIER = "CREATE TABLE IF NOT EXISTS `calendrier` ("+
  "`id_calendrier` int(11) NOT NULL auto_increment,`annee` int(11) NOT NULL,"+
  "`nom_mois` enum('January','February','Mars','April','May','June','July','August','September','October','November','December') NOT NULL,"+
  "`nr_mois` int(11) NOT NULL,`jour_mois` int(11) NOT NULL,`type_jour` enum('weekend','normal','ferie') NOT NULL,PRIMARY KEY  (`id_calendrier`))";
	

	public static String PAIEMENT = "CREATE TABLE IF NOT EXISTS `paiement` ("+
			  "`id_mode_paiement` int(11) NOT NULL auto_increment,"+
			  "`mode` enum('VISA','MASTERCARD','PAYPAL','CHEQUE BANCAIRE') NOT NULL,"+
			  "PRIMARY KEY  (`id_mode_paiement`))";
	
	public static String PRIX_PERIODE = "CREATE TABLE IF NOT EXISTS `prix_periode`("+
			  "`id_prix_date_dispo` int(11) NOT NULL auto_increment,`id_gite` int(11) NOT NULL,"+
			  "`id_date` int(11) NOT NULL,`prix_normal` int(10) unsigned NOT NULL,"+
			  "`prix_reduction` int(10) unsigned NOT NULL,PRIMARY KEY  (`id_prix_date_dispo`),"+
			  "KEY `id_gite` (`id_gite`))";
	
	public static String QUALITE_GITE = "CREATE TABLE IF NOT EXISTS `qualite_gite` ("+
  "`id_qualite` int(11) NOT NULL auto_increment,`id_gite` int(11) NOT NULL,"+
  "`id_confort` int(11) NOT NULL,`particularites` varchar(100) NOT NULL,"+
  "PRIMARY KEY  (`id_qualite`),KEY `id_gite` (`id_gite`))";
	
	public static String TOURISME = "CREATE TABLE IF NOT EXISTS `tourisme` ("+
  "`id_tourisme` int(11) NOT NULL auto_increment,`id_gite` int(11) NOT NULL,"+
  "`id_liens` int(11) NOT NULL,`distance` int(10) unsigned NOT NULL,"+
  "PRIMARY KEY  (`id_tourisme`),KEY `id_gite` (`id_gite`),KEY `id_liens` (`id_liens`))";
	
	public static String LIEU_TOURISTIQUE = "CREATE TABLE IF NOT EXISTS `lieu_touristique` ("+
  "`id_lieu` int(11) NOT NULL auto_increment,`nom_lieu` varchar(30) NOT NULL,"+
  "`adresse` varchar(200) NOT NULL,`ville` varchar(20) NOT NULL,`description` varchar(200) NOT NULL,"+
  "`moyen_transportation` varchar(50) NOT NULL,PRIMARY KEY  (`id_lieu`))";
	
	public static String ATTRACTION = "CREATE TABLE IF NOT EXISTS `attraction` ("+
  "`id_attraction` int(11) NOT NULL auto_increment,`id_lieu` int(11) NOT NULL,"+
  "`nom_attraction` varchar(40) NOT NULL,`description` varchar(200) NOT NULL,"+
 "`date_debut` datetime NOT NULL,`date_fin` datetime NOT NULL,PRIMARY KEY  (`id_attraction`))";
	
	public static String CONFORT = "CREATE TABLE IF NOT EXISTS `confort` ("+
  "`id_confort` int(11) NOT NULL auto_increment,`type_confort` varchar(10) NOT NULL,"+
  "`nom_confort` varchar(20) NOT NULL,  PRIMARY KEY  (`id_confort`))";
	
	public static String SELECT_CLIENT="SELECT * FROM CLIENT ";
	public static String SELECT_RESERVATION="SELECT * FROM RESERVATION ";
	
	public static List<String> getScriptCreateTable(){
	List<String> list=new ArrayList<String>();
	list.add(CLIENT);
	list.add(RESERVATION);
	list.add(CONFORT);
	list.add(CALENDRIER);
	list.add(PAIEMENT);
	list.add(PRIX_PERIODE);
	list.add(LIEU_TOURISTIQUE);
	list.add(TOURISME);
	list.add(GITE);
	
	return list;
	}

}
